org 0x7c00
[bits 16]
xor ax, ax ; eax = 0
; 初始化段寄存器, 段地址全部设为0
mov ds, ax
mov ss, ax
mov es, ax
mov fs, ax
mov gs, ax

; 初始化栈指针
mov sp, 0x7c00
mov ax, 0xb800
mov gs, ax

; 获取位置
mov ah,03h
mov bx,0
int 10h

; 设置位置
mov ah,02h
mov bh,0
;mov dh,ch
;mov dl,cl
add dh,10
add dl,10
int 10h

; 书写
mov ah,09h
mov al, '2'
mov bh,0
mov bl,0x03
mov cx,2
int 10h

; 更改位置
mov ah,02h
add dl,2
int 10h

mov ah,09h
mov al,'3'
mov cx,2
int 10h
mov ah,02h
add dl,2
int 10h

mov ah,09h
mov al,'6'
mov cx,1
int 10h
mov ah,02h
add dl,1
int 10h

mov ah,09h
mov al,'2'
mov cx,1
int 10h
mov ah,02h
add dl,1
int 10h

mov ah,09h
mov al,'7'
mov cx,1
int 10h
mov ah,02h
add dl,1
int 10h

mov ah,09h
mov al,'1'
mov cx,1
int 10h
mov ah,02h
add dl,2
int 10h

;中断键入
key_in:
mov ah,0
int 16h
cmp al,1bh ;is ESC?
je esc

mov ah,09h
int 10h
mov ah,02h
add dl,1
int 10h
jmp key_in
esc:
jmp $ ; 死循环

times 510 - ($ - $$) db 0
db 0x55, 0xaa
